package t1client;

import java.sql.SQLException;
import java.util.Scanner;

import t1invoke.Invoke;

public class Client {

	public static void main(String[] args) throws SQLException {
		Scanner sc = new Scanner(System.in);
		Invoke in = new Invoke();
		Integer n = 0;
		while (true) {
			System.out.println("输入1查询全部学生");
			System.out.println("输入2按专业查询学生");
			System.out.println("输入3按姓名查询学生");
			System.out.println("输入4添加学生");
			System.out.println("输入0退出");
			n = Integer.parseInt(sc.nextLine());
			switch (n) {
			case 1:
				in.selectAll();
				break;
			case 2:
				in.selectStudentByMajor(sc);
				break;
			case 3:
				in.selectStudentByName(sc);
				break;
			case 4:
				in.insertStudent(sc);
				break;
			}
			if (n == 0) {
				System.out.println("退出成功");
				break;
			}
		}
		sc.close();
	}

}
